#ifndef __G2_DEBUG_H__
#define __G2_DEBUG_H__


//debug
#define _G2_DEBUG_

#ifdef _G2_DEBUG_
#define G2_While(a) while(a) 
#else
#define G2_While(a)
#endif

#define G2_Assert(a,s)\
	if(!(a)){ printf("G2== %s, %d, %s \n ", s, __LINE__, __FILE__ ); G2_While(1); }

#define G2_Assert2(a, fmt,...)\
	if(!(a)){ printf("G2== %d, %s ", __LINE__, __FILE__ ); printf(fmt, ##__VA_ARGS__); G2_While(1); }

#define G2_Printf(fmt,...) \
	printf(fmt, ##__VA_ARGS__);\
	printf("== G2: %d, %s\n",  __LINE__, __FILE__);


#define G2_Undo(s) \
	printf("G2==Undo: %s, %d, %s \n", s, __LINE__, __FUNCTION__)

//
#define G2_NOT_USED(x) 	((void)(x))
#endif

